import { $get } from '@js/request'
import { OrderSchema } from '@components/Schema/OrderSchema'

// 获取带支付列表
export async function getCaseListRequest (): Promise<OrderSchema[]> {
  const condition = [{ k: 'status', o: '=', v: '支付中' }]
  const res = await $get('/api/xd/order', {
    page_size: 1000,
    current: 1,
    condition: JSON.stringify(condition)
  })
  if (res.status !== 1) {
    throw new Error(res.message)
  }
  return res.data.list.map((li: OrderSchema, i: number) => {
    li.order = i + 1
    return li
  })
}
